package com.googlecode.linkmein.service

import com.google.gdata.client.photos.PicasawebService
import com.googlecode.linkmein.domain.Albums
import com.googlecode.linkmein.domain.Contact
import com.googlecode.linkmein.domain.Contacts

class PicasaService {
    boolean transactional = true

    public Albums findAlbums(Contacts contacts) {
        PicasawebService service = new PicasawebService("link.me.in")
        Albums albums = new Albums();
        for (Contact contact: contacts) {
            def googleid = contact.googleIdWithOutGmail();
            albums.addAll(Albums.find(service, googleid));
        }
        return albums;
    }
}